#=head1 NAME
#
# Makefile - creates html sources
#
#=head1 DESCRIPTION
#
#The creation is divided into two separate steps. The first one
#created pod links. This is needed by pod2html to follow the links
#notified by L commands in the pod documentation. The second step
#creates the html sources from it. All subdirectories written in
#the DIRS variables are also followed to search for other Makefile.
#

#
#=head1 SEE ALSO
#
#the targets:
#L<"index.pod">
#L<"install">
#
#=head1 AUTHOR
#
# Franck Giron
# $Id: Makefile,v 1.1 2007/10/08 09:26:02 schweitz Exp $
#
#=head1 LOG
#
# $Log: Makefile,v $
# Revision 1.1  2007/10/08 09:26:02  schweitz
# version 2.4, lib vergessen
#
# Revision /main/5  20-Aug-2001.17:42:13  giron1
# Adaptation to new standard doc generation.
# 
# Revision 1.4  2001/03/05 16:58:29  giron1
# cvs id change
#
# Revision 1.3  2000/05/12 15:25:52  giron1
# Cvs id not updated
#
# Revision 1.2  2000/05/12 14:55:18  giron1
# Target and pod doc added for creation of Makefile.html
#
#
#=cut

LOCALPODPATH = .:./packs/html
DIRS = packs dbase util
WEBPERLPATH = $(COMMON_MMIV)/vobs/speech/WEB/speech/links/software/perl

all: $(DIRS:=.dir) mmidoc

$(DIRS:=.dir):
	cd $(@:.dir=); $(MAKE) mmidoc

#=head2 index.pod
#
#The target index.pod creates automatically the index to the other
#perl programs in this directory.Some small changes are done in the
#BODY part to get the same background image as our standard web pages.
#
#=cut

index.pod: Makefile
	@echo > $@
	@echo '=head1 Perl Tools' >> $@
	@echo >> $@
	@echo 'The perl directory contains several L<perl|html/index> programs and L<"subdirectories">.' >> $@
	@echo 'The programs stored in the L<perl|html/index> root directories are basic programs' >> $@
	@echo 'related to the experiments, like the creation of dictionaries and net files.' >> $@
	@echo >> $@
	@echo '=head2 subdirectories' >> $@
	@echo >> $@
	@echo 'L<packs|packs/html/index> : This subdirectory contains packages which are used by the other programs.' >> $@
	@echo >> $@
	@echo 'L<dbase|dbase/html/index> : This subdirectory contains tools related to the management of the speech database (speech and label files).' >> $@
	@echo >> $@
	@echo 'L<util|util/html/index> : This subdirectory contains diverse utilities.' >> $@
	@echo >> $@
	@echo '=head1 AUTHOR' >> $@
	@echo >> $@
	@echo ' Franck Giron' '$$Id: Makefile,v 1.1 2007/10/08 09:26:02 schweitz Exp $$'>> $@
	@echo >> $@
	@echo '=cut' >> $@
	@echo >> $@

#=head2 install
#
#The install target copies all html file in my personal version
#of the WEB pages. You have to modify the WEBPERLPATH to your
#corresponding path if you want to use this Makefile.
#
#=cut

install:
	for dir in $(DIRS);\
	do cp `ls $$dir/*.html` $(WEBPERLPATH)/$$dir ;\
	done
	cp `ls *.html` $(WEBPERLPATH)

# Path to other module relative to this one
#LOCALPODPATH = ./packs/html
# Include makefile for documentation if COMMON_MMIV is defined
ifdef COMMON_MMIV
include $(COMMON_MMIV)/vobs/speech/scripts/mk/makedocStandard.mk
endif

index.html: index.pod
	pod2html --podpath=. --podroot=. --htmlroot=. --infile=$< --outfile=tmp1.html
	sed -e 's_<BODY>_<BODY background="../../../image/back.gif">_' tmp1.html > $@
	rm -f tmp1.html
